<template>
  <div class="slider-component">
    <el-slider
      v-model="datas.value"
      :min="datas.min"
      :max="datas.max"
      :step="datas.step"
      :show-stops="datas.showStops"
      :show-input="datas.showInput"
      :range="datas.range"
      :vertical="datas.vertical"
      :height="datas.vertical ? datas.height : ''"
      :disabled="datas.disabled"
      :style="{
        '--el-slider-main-bg-color': datas.activeColor,
        '--el-slider-runway-bg-color': datas.backgroundColor
      }"
    ></el-slider>
    
  </div>
</template>

<script>
export default {
  name: 'slider',
  props: {
    datas: {
      type: Object,
      required: true
    },
  },
}
</script>

<style scoped lang="less">
.slider-component {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  
  :deep(.el-slider) {
    width: 100%;
    margin: 0;
  }
}
</style> 